package com.zwp.base.widget

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatDialogFragment
import androidx.compose.ui.platform.ComposeView
import androidx.fragment.app.FragmentManager
import com.zwp.base.R
import com.zwp.base.ui.compose.LoadingView



class LoadingDialogFragment() : AppCompatDialogFragment() {
    private val TAG = "LoadingDialog"

    var message = "Loading.."

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View {
        return ComposeView(requireContext()).apply {
            setContent {
                LoadingView(message)
            }
        }
    }

    override fun getTheme(): Int = R.style.BaseDialogStyle

    fun show(manager:FragmentManager) {
        show(manager, TAG)
    }
}